package ref;

import lombok.Getter;
import lombok.Setter;

import java.util.function.Supplier;

/**
 * Author:ZouHeng
 * Description:
 * Date:2021-07-05  15:43
 **/
@Getter
@Setter
public class Car {

    private String name;
    private String color;
    private Integer price;

    public static Car create(final Supplier<Car> supplier) {
        return supplier.get();
    }

    public static void collide(final Car car) {
        System.out.println("Collided " + car.toString());
    }

    public void follow(final Car another) {
        System.out.println("Following the " + another.toString());
    }

    public void repair() {
        System.out.println("Repaired " + this.toString());
    }

}
